Software profiling is a form of program analysis that investigates a software program's behavior using information gathered as the program executes. A compiler may use software profiling in order to identify particular sections of a software program for which to optimize, such as an event-based profiler, a statistical profiler, or an instrumentation profiler. An event-based profiler may be configured to trap events such as calls and class-loads. A statistical profiler may be configured to probe a software program's program counter at regular intervals using operating system interrupts. And, an instrumentation profiler may add additional instructions to the software program in order to gather information as the program executes.